package com.matt.domain.news;
import com.matt.commons.model.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * *******************************
 * Created by lch.
 * form com.matt
 * on $date$
 * *******************************
 */
@Entity
@Data
@Table(name = "system_notification")
@EqualsAndHashCode(callSuper = true)
public class SystemNotification extends Model {

    @Column(columnDefinition = "varchar(255) COMMENT '名称'")
    private String name;

    @Column(columnDefinition = "longtext COMMENT '富文本'")
    private String text;

    @Column(columnDefinition = "int default 0 COMMENT '分类 0：无菜单  1：有菜单'")
    private Integer category=0;

    @Column(columnDefinition = "longtext COMMENT '穷文本'")
    private String description;

    @Column(columnDefinition = " datetime COMMENT '时间' ")
    private Date date;

    @Column(columnDefinition = "datetime DEFAULT NOW() COMMENT '创建时间'")
    private Date createTime = new Date();

    public static SystemNotification of(String name,String text,String description,Date date){
        SystemNotification vo = new SystemNotification();
        vo.setName(name);
        vo.setText(text);
        vo.setDescription(description);
        vo.setDate(date);
        return vo;
    }



}
